+2007-01-02 Matthias Clasen <mclasen@redhat.com>
+
+ Try to fix #315732, reported by Luke Hutchinson:
+
+ * gdk/x11/xsettings-client.[hc]:
+ * gdk/x11/gdkdevents-x11.c: Don't assume that ref'ing a GdkWindow
+ will guarantee that it can be looked up in the xid hash later.
+ Also, use the nesting server grab function during the xsettings
+ client initialization. Finally, make xsettings client not
+ eat DestroyNotifys so that GDK can do its regular cleanup.
+
2007-01-02 Michael Natterer <mitch@imendio.com>
* gtk/gtkrange.c (gtk_range_scroll) (gtk_range_move_slider): beep
*/
/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
+ * Modified by the GTK+ Team and others 1997-2007. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
/* Keep a flag to avoid extra notifies that we don't need
*/
screen_x11->xsettings_in_init = TRUE;
- screen_x11->xsettings_client = xsettings_client_new (screen_x11->xdisplay,
- screen_x11->screen_num,
- gdk_xsettings_notify_cb,
- gdk_xsettings_watch_cb,
- screen);
- xsettings_client_set_grab_func (screen_x11->xsettings_client,
- refcounted_grab_server);
- xsettings_client_set_ungrab_func (screen_x11->xsettings_client,
- refcounted_ungrab_server);
+ screen_x11->xsettings_client = xsettings_client_new_with_grab_funcs (screen_x11->xdisplay,
+ screen_x11->screen_num,
+ gdk_xsettings_notify_cb,
+ gdk_xsettings_watch_cb,
+ screen,
+ refcounted_grab_server,
+ refcounted_ungrab_server);
screen_x11->xsettings_in_init = FALSE;
}
{
if (!gdkwin)
gdkwin = gdk_window_foreign_new_for_display (gdk_screen_get_display (screen), window);
- else
- g_object_ref (gdkwin);
gdk_window_add_filter (gdkwin, gdk_xsettings_client_event_filter, screen);
}
else
{
- g_assert (gdkwin);
- gdk_window_remove_filter (gdkwin, gdk_xsettings_client_event_filter, screen);
- g_object_unref (gdkwin);
+ if (gdkwin)
+ gdk_window_remove_filter (gdkwin, gdk_xsettings_client_event_filter, screen);
}
}
/*
- * Copyright © 2001 Red Hat, Inc.
+ * Copyright © 2001, 2007 Red Hat, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
XSettingsNotifyFunc notify,
XSettingsWatchFunc watch,
void *cb_data)
+{
+ return xsettings_client_new_with_grab_funcs (display, screen, notify, watch, cb_data,
+ NULL, NULL);
+}
+
+XSettingsClient *
+xsettings_client_new_with_grab_funcs (Display *display,
+ int screen,
+ XSettingsNotifyFunc notify,
+ XSettingsWatchFunc watch,
+ void *cb_data,
+ XSettingsGrabFunc grab,
+ XSettingsGrabFunc ungrab)
{
XSettingsClient *client;
char buffer[256];
client->notify = notify;
client->watch = watch;
client->cb_data = cb_data;
- client->grab = NULL;
- client->ungrab = NULL;
+ client->grab = grab;
+ client->ungrab = ungrab;
client->manager_window = None;
client->settings = NULL;
return client;
}
+
void
xsettings_client_set_grab_func (XSettingsClient *client,
XSettingsGrabFunc grab)
if (xev->xany.type == DestroyNotify)
{
check_manager_window (client);
- return True;
+ /* let GDK do its cleanup */
+ return False;
}
else if (xev->xany.type == PropertyNotify)
{
/*
- * Copyright © 2001 Red Hat, Inc.
+ * Copyright © 2001, 2007 Red Hat, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
XSettingsNotifyFunc notify,
XSettingsWatchFunc watch,
void *cb_data);
+XSettingsClient *xsettings_client_new_with_grab_funcs (Display *display,
+ int screen,
+ XSettingsNotifyFunc notify,
+ XSettingsWatchFunc watch,
+ void *cb_data,
+ XSettingsGrabFunc grab,
+ XSettingsGrabFunc ungrab);
void xsettings_client_set_grab_func (XSettingsClient *client,
XSettingsGrabFunc grab);
void xsettings_client_set_ungrab_func (XSettingsClient *client,